const {request} = require("../utils/request")
const {baseUrl, banner, goods, hotSearch, search, goodsDetails, cart, addCart, delCart, category, buy, login} = require("./base")
/**
 * 网络请求方法
 */

 /**
  * getBanner data
  */

function getBanner(data){
    return request(baseUrl+banner, "GET", data)
}

/**
 * 商品列表
 */
function getGoods(data){
    return request(baseUrl + goods, "GET", data)
}

function getHotSearch(data){
    return request(baseUrl + hotSearch, "GET", data);
}

function getSearch(data) {
    return request(baseUrl + search, "GET", data);
}


function getGoodsDetails(data){
    return request(baseUrl + goodsDetails, "GET", data);
}

function getCart(data){
    return request(baseUrl + cart, "GET", data);
}

function addGoodsCart(data){
    return request(baseUrl + addCart, "GET", data);
}

function delGoodsCart(data){
    return request(baseUrl + delCart, "GET", data);
}

function getCategory(data){
    return request(baseUrl + category, "GET", data);
}

function getBuy(data){
    return request(baseUrl + buy, "GET", data);
}

function Login(data){
    return request(baseUrl + login, "POST", data);
}

module.exports = {
    getBanner,
    getGoods,
    getHotSearch,
    getSearch,
    getGoodsDetails,
    getCart,
    addGoodsCart,
    delGoodsCart,
    getCategory,
    getBuy,
    Login,
}